<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>AMD模块加载器</title>
</head>
<body>
<script src="../js/pig.js"></script>
<script>
    require.config({
        paths: {
			'user': './js/user.js',
            'book': './js/book.js',
            'fish': './js/fish.js',
            style: 'css!css/style'
		},
		/**
		 * 模块依赖
		*/
		shim : {
			'user' : {
				'deps' : ['book','style']
			}
		}
    })

    require(['./js/user.js'], function (user) {
        console.log(user.getName())
        var bird = require.request('./js/bird')
        console.log(bird)
        require(['./js/user.js', './js/dog.js', './js/book.js', '../../../../../vendor/angular/1.3.2/angular.js'], function (
            user, dog, book, angular
        ) {
            console.log('********************')

            console.log('user：' + user.getName())
            console.log('dog：' + dog.getName())
            console.log('book：' + book.getName())
            console.log(angular)
        })

        require(['./js/dog.js'], function () {
            console.log(99999)
        })

        require(function () {
            console.log('require.request')
        })
    }).then(function () {
        console.log(88888)
    }).then(function (user) {
        console.log(88889)
        console.log('user：' + user.getName())
    })
</script>
</body>
</html>